package cn.iocoder.yudao.module.member.growth.controller.app;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.member.assets.service.AppMemberDigitalAssetsService;
import cn.iocoder.yudao.module.member.assets.vo.AppGrowthOverviewRespVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;

@Tag(name = "用户 App - 贡献值")
@RestController
@RequestMapping("/member/growth")
@Validated
public class AppGrowthController {
    @Resource
    private AppMemberDigitalAssetsService appMemberDigitalAssetsService;

    @GetMapping("/overview")
    @Operation(summary = "获得贡献值概览")
    public CommonResult<AppGrowthOverviewRespVO> getGrowthOverview() {
        return success(appMemberDigitalAssetsService.getGrowthOverview(getLoginUserId()));
    }

}